home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / plot.lha / plot.s / __headers__.txt
Encoding:
Text File  |  1993-02-04  |  2.7 KB  |  70 lines

  1.  
  2. In article <1993Jan31.171831.6931@desire.wright.edu>  
  3. fheitkamp@desire.wright.edu writes:
  4. >In article <1993Jan30.112215.9215@imada.ou.dk>, breese@monet.imada.ou.dk  
  5. (Bjorn Reese) writes:
  6. >> Out of pure curiosity, I did some speed tests on different
  7. >> line drawing routines.
  8. >> 
  9. >> 
  10. >> WritePixel() looses badly to your own plot routines.
  11. >
  12. >    How does one go about writing a speedy substitute for WritePixel()?
  13.  
  14. That's not very hard, but the plot routine which I used in the speed tests
  15. was too optimized to be used anywhere else.
  16.  
  17. A more generic (though it must be re-coded if the screen depth is changed),
  18. yet still fast, routine can be found below the dashed line. It plots to 3
  19. interleaved bitmaps. If you use normal bitmaps, you must make sure that the
  20. bitplanes are consecutive. The source is for AsmOne and Devpac.
  21.  
  22. This plot routine is approx. 4 times faster than WritePixel().
  23.  
  24. --
  25.  
  26. Bjorn Reese                    |     Email: breese@imada.ou.dk
  27. Odense University, Denmark     |     Voice: +45 65 932 182 (private)
  28.  
  29. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  30.  
  31. ;------------------------------------------------------------------
  32. ;    @Plot3
  33. ;------------------------------------------------------------------
  34. ; IN    d0.w    = x
  35. ;    d1.w    = y
  36. ;    d2.w    = color
  37. ;    a0.l    = ^Screen
  38. ; USED    d0-d1/a1
  39. ; TIME    158cc
  40. ; breese@imada.ou.dk(Bjorn Reese)
  41. ;------------------------------------------------------------------
  42.  
  43. ;--- For Normal (consecutive) BitMaps
  44. ;NxtPlane = ScreenWidth*ScreenDepth
  45. ;NxtMulu  = ScreenWidth
  46.  
  47. ;--- For Interleaved BitMaps
  48. NxtPlane = ScreenWidth
  49. NxtMulu  = ScreenWidth*ScreenDepth
  50.  
  51.  
  52. Plot3:    lea    MuluArray(pc),a1    add.w    d1,d1    move.w    (a1,d1.w),a1    adda.l    a0,a1        ;ScrPtr += y * Width    move.w    d0,d1    not.b    d1        ;Bit Number    asr.w    #3,d0    adda.w    d0,a1        ;ScrPtr += x    move.w    d2,d0    add.w    d0,d0    move.w    JumpArray(pc,d0.w),d0    jmp    JumpArray(pc,d0.w)
  53.  
  54. JumpArray:    dc.w    Col000-JumpArray,Col001-JumpArray    dc.w    Col010-JumpArray,Col011-JumpArray    dc.w    Col100-JumpArray,Col101-JumpArray    dc.w    Col110-JumpArray,Col111-JumpArray
  55.  
  56. Col000:    bclr.b    d1,(a1)    bclr.b    d1,NxtPlane(a1)    bclr.b    d1,2*NxtPlane(a1)    rts
  57. Col001:    bset.b    d1,(a1)    bclr.b    d1,NxtPlane(a1)    bclr.b    d1,2*NxtPlane(a1)    rts
  58. Col010:    bclr.b    d1,(a1)    bset.b    d1,NxtPlane(a1)    bclr.b    d1,2*NxtPlane(a1)    rts
  59. Col011:    bset.b    d1,(a1)    bset.b    d1,NxtPlane(a1)    bclr.b    d1,2*NxtPlane(a1)    rts
  60. Col100:    bclr.b    d1,(a1)    bclr.b    d1,NxtPlane(a1)    bset.b    d1,2*NxtPlane(a1)    rts
  61. Col101:    bset.b    d1,(a1)    bclr.b    d1,NxtPlane(a1)    bset.b    d1,2*NxtPlane(a1)    rts
  62. Col110:    bclr.b    d1,(a1)    bset.b    d1,NxtPlane(a1)    bset.b    d1,2*NxtPlane(a1)    rts
  63. Col111:    bset.b    d1,(a1)    bset.b    d1,NxtPlane(a1)    bset.b    d1,2*NxtPlane(a1)    rts
  64.  
  65. MuluArray:
  66. aaa    SET    0    REPT    ScreenHeight    dc.w    aaa
  67. aaa    SET    aaa+NxtMulu    ENDR
  68.  
  69.  
  70.